#!/bin/bash -i
srcPath=/home/ubt/programs/golang/src/ubt-aio-service/aio-admin
dstPath=/home/ubt/apps/ubt-aio-service
addName=aio-admin
echo "Build the project Begin!"
echo "Go into the srouce path of project directory: $srcPath"
cd $srcPath
echo "Update the New Program."
git pull
echo "Check and update the go libs."
yarn
echo "Build the project."
yarn build:prod
echo "Delete the old program."
rm -rf $dstPath/$addName/
echo "Move the executed file to $dstPath"
mv $addName/ $dstPath/
echo "Build the project finished!"

